package cn.gemiman.daoyi.module.iot.dal.mysql.jhlequipmentplace;

import cn.gemiman.daoyi.framework.common.pojo.PageResult;
import cn.gemiman.daoyi.framework.mybatis.core.mapper.BaseMapperX;
import cn.gemiman.daoyi.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gemiman.daoyi.module.iot.controller.admin.jhlequipmentplace.vo.JhlEquipmentPlacePageReqVO;
import cn.gemiman.daoyi.module.iot.dal.dataobject.jhlequipmentplace.JhlEquipmentPlaceDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 精华隆场所信息 Mapper
 *
 * @author 道一源码
 */
@Mapper
public interface JhlEquipmentPlaceMapper extends BaseMapperX<JhlEquipmentPlaceDO> {

    default PageResult<JhlEquipmentPlaceDO> selectPage(JhlEquipmentPlacePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JhlEquipmentPlaceDO>()
                .eqIfPresent(JhlEquipmentPlaceDO::getLevel, reqVO.getLevel())
                .eqIfPresent(JhlEquipmentPlaceDO::getMainCode, reqVO.getMainCode())
                .likeIfPresent(JhlEquipmentPlaceDO::getPlaceName, reqVO.getPlaceName())
                .eqIfPresent(JhlEquipmentPlaceDO::getParentId, reqVO.getParentId())
                .betweenIfPresent(JhlEquipmentPlaceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JhlEquipmentPlaceDO::getId));
    }

}
